<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script type="text/javascript">

    function Person (name, age, gender) {
        this.name = name
        this.age = age
        this.gender = gender
        this.sayName = () => {
            console.log(name)
        }
    }
    var bajie = new Person('八戒', '500', '男')
    var shashidi = new Person('悟净', '500', '男')

    console.log(bajie.constructor === Person)       //true
    console.log(shashidi.constructor === Person)    //true

    console.log(bajie instanceof Object)    //true
    console.log(bajie instanceof Person)    //true
    console.log(shashidi instanceof Object)
    console.log(shashidi instanceof Person)

</script>

</body>
</html>
